﻿using System;

namespace xycn.IAuthorize
{
    /// <summary>
    /// 权限验证接口
    /// </summary>
    public interface IAuthorize
    {
        /// <summary>
        /// 获取签名信息 Authorization 授权后访问需带上 Authorization：Bearer {Token}
        /// </summary>
        /// <param name="authInfo">用户信息</param>
        /// <returns></returns>
        string CreateSign(SignInfo authInfo);

        /// <summary>
        /// 判断认证是否通过
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        bool IsSuccess(string token);

        /// <summary>
        /// 获取授权信息
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        SignInfo GetSignInfo(string token);
    }
}
